using System.Collections.Generic;
using GrapeCity.Forguncy.Commands;
using GrapeCity.Forguncy.Plugin;

namespace TencentCloudOcrPlugin.Designer
{
    public class TencentCloudOcrPluginServerCommandDesigner : CommandDesigner<TencentCloudOcrPluginServerCommand>
    {
        public override void OnPropertyEditorChanged(string propertyName, object propertyValue, Dictionary<string, IEditorSettingsDataContext> properties)
        {
            if (propertyName == "OperationType" && propertyValue is TencentCloudApiOperationType operationType)
            {
                properties["OperationParams"].Value = TencentCloudApiOperationFactory.GetSetting(operationType);
            }
            base.OnPropertyEditorChanged(propertyName, propertyValue, properties);
        }
    }
}
